package com.zhj.goods.controller;

import com.zhj.goods.model.vo.R;
import com.zhj.goods.service.StatisticService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("api")
public class StatisticController {
    @Resource
    private StatisticService service;

    // 得到4个版块的数据
    @GetMapping("getFourBlock")
    public R getFourBlock() {
        return R.success(service.getFourBlock());
    }

    // 获取利润情况，第二块的
    @GetMapping("getDailyProfitStat")
    public R getDailyProfitStat() {
        return R.success(service.getDailyProfitStat());
    }

    // 获取完成的订单，（采购订单，销售订单）
    @GetMapping("getDailyFinishOrder")
    public R getDailyFinishOrder() {
        return R.success(service.getDailyFinishOrder());
    }

    // 最后一个版块的
    @GetMapping("getTotalProfitGoods")
    public R getTotalProfitGoods() {
        return R.success(service.getTotalProfitGoods());
    }

    @GetMapping("getCustomer")
    public R getCustomerDetail() {
        return R.success(service.getCustomer());
    }

    @GetMapping("getSupply")
    public R getSupplyDetail() {
        return R.success(service.getSupply());
    }

}
